<?php
namespace app\index\model;

use think\Model;
//use think\Db;

class Index extends Model {

    public function index()
    {
        //1.先按照id顺序 查询出4篇带有图片描述的文章
        $title_list = Db::name('blog')->field('id,title,summary,title_img')->where('title_img','NEQ','')->order('id DESC')->limit(4)->select();
        //dump($title_list);
        $data['title_list'] = $title_list;

        //2.取下面大图文章
        $list = Db::name('blog')->field('id,title,summary,big_img,content')->order('id desc')->limit(5)->select();
        //dump($list);
        $data['list'] = $list;

        return $data;
    }
}